#include "../../libs/LocalStack/LocalStack.h"

void floatDeleter(void * a)
{
	printf("Deleteing interger with value %f\n", (*(float*)a) + 1);
	free(a);
}

void intDeleter(void * a)
{
	printf("Deleteing interger with value %d\n", (*(int*)a) - 1);
	free(a);
}

void test2 (float k)
{
	START();
		
	float * a = (float*)NEWD(sizeof(float), floatDeleter);
		
	*a= k;
		
	Assert(k == 2);
		
	RETURN();
}

void test (float k)
{
	START();
	
	float * a = (float*)NEWD(sizeof(float), floatDeleter);
	
	*a= k;
	
	test2(2);
	Assert(k == 2 + 1);
	
	RETURN();
}

int main()
{
	InitGlobalStack();
	START();

	int * a = (int*)NEWD(sizeof(int), intDeleter);
	
	*a = 4;
	test(7);
	
	RETURN(0);
}
